package com.program.facesigninsystem.dao;

import com.program.facesigninsystem.entity.Classes;
import com.program.facesigninsystem.entity.UserInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

@Repository
public interface IUserInfoDao {
    /****
     * 登录
     * @param openid
     * @return
     */
    UserInfo loginUser(@Param("openid") String openid);

    /****
     * 为用户添加token
     * @param uid
     * @param token
     */
    void  updateToken(@Param("uid")String uid,@Param("token")String token);

    /****
     * 添加新用户
     * @param uid
     * @param openid
     * @param token
     */
    void addUser(@Param("uid")String uid,@Param("openid")String openid,@Param("token")String token);

    /****
     * 更新用户信息
     * @param uid
     * @param name
     * @param type
     * @param major
     * @param uclass
     * @param university
     * @param academy
     */
    void updateUser(@Param("uid")String uid,@Param("name")String name,@Param("type")int type,@Param("major")String major,@Param("uclass")String uclass,@Param("university")String university,@Param("academy")String academy);

    /****
     * 返回用户信息
     * @param uid
     * @return
     */
    UserInfo selectUser(@Param("uid")String uid);
}
